<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/6/26
 * Time: 15:57
 */
$yphp = '';
$ypgj = '';
$ypfy = '';
$ypbj = '';
$ypxx = '';

$yaopin = $game->yp_get_info_sys($arr_data->ypid);
$playeryp = $game->yp_get_info($arr_data->ypid);

$设置药品1 = "";
$设置药品2 = "";
$设置药品3 = "";
$使用药品 = "";

$tishi='';


switch ($arr_data->cmd2){
    case 'setyp':
        $game->player_update_ypwz($arr_data->canshu , $arr_data->ypid );
        $tishi = "设置药品{$arr_data->canshu}成功<br/>";
        break;
    case 'useyp':

        $ret = $game->yp_use( $arr_data->ypid , 1);
        if ($ret){
            $tishi = "使用药品成功<br/>";
        }else{
            $tishi = "使用药品失败<br/>";
        }
        break;
}

if ($playeryp){
    $设置药品1 = $game->create_url( "cmd=ypinfo&cmd2=setyp&canshu=1&ypid=$arr_data->ypid","装备药品1 ");
    $设置药品2 = $game->create_url("cmd=ypinfo&cmd2=setyp&canshu=2&ypid=$arr_data->ypid","装备药品2 ");
    $设置药品3 = $game->create_url("cmd=ypinfo&cmd2=setyp&canshu=3&ypid=$arr_data->ypid","装备药品3 ");
    $使用药品 = $game->create_url("cmd=ypinfo&cmd2=useyp&ypid=$arr_data->ypid","使用 ");

}
if($yaopin->yphp!=0){
    $yphp = "气血$yaopin->yphp<br/>";
}

if ($yaopin->ypgj!=0){
    $ypgj = "攻击$yaopin->ypgj<br/>";
}

if ($yaopin->ypfy!=0){
    $ypfy = "防御$yaopin->ypfy<br/>";
}

if ($yaopin->ypbj!=0){
    $ypbj = "暴击$yaopin->ypbj<br/>";
}

if ($yaopin->ypxx!=0){
    $ypxx = "吸血$yaopin->ypxx<br/>";
}


$ypinfo = "
$tishi
[$yaopin->ypname]<br/>
{$yphp}{$ypgj}{$ypfy}{$ypbj}{$ypxx}<br/>
{$设置药品1}{$设置药品2}{$设置药品3}<br/>
{$使用药品}
<br/>

{$变量_系统->链接_返回游戏}
";
echo $ypinfo;